package com.knowledge.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.knowledge.dao.dos.Archives;
import com.knowledge.dao.entity.Article;
import com.knowledge.vo.Result;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zzz
 * @create 2022-02-10 16:12
 */
public interface ArticleMapper extends BaseMapper<Article> {

    List<Archives> listArchives();

    IPage<Article> listArticle(Page<Article> page,
                               Long categoryId,
                               Long tagId,
                               String year,
                               String month,
                               Integer favorite,
                               Long userId,
                               Integer MyArticleFlag,
                               String keyword);

    void pushTop(@Param("weight") int weight, @Param("id") long id);

    int getMaxWeight();

}
